package cluster

import (
	"kms-backend/controllers/cluster"

	"github.com/gin-gonic/gin"
)

// 新增
func add(clusterGroup *gin.RouterGroup) {
	clusterGroup.POST("/add", cluster.Add)
}

// 更新
func update(clusterGroup *gin.RouterGroup) {
	clusterGroup.POST("/update", cluster.Update)
}

func detail(clusterGroup *gin.RouterGroup) {
	clusterGroup.GET("/detail", cluster.Detail)
}

func list(clusterGroup *gin.RouterGroup) {
	clusterGroup.GET("/list", cluster.List)
}

func delete(clusterGroup *gin.RouterGroup) {
	clusterGroup.GET("/delete", cluster.Delete)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	// 配置路由策略
	clusterGroup := g.Group("/cluster")
	add(clusterGroup)
	update(clusterGroup)
	detail(clusterGroup)
	list(clusterGroup)
	delete(clusterGroup)

}
